<template>
    <h3>组件A</h3>
    <p>{{msg}}</p>
    <button @click="up">更新</button>
</template>
<script>
export default{
    data(){
        return{
            msg:"老数据"
        }
    },
    beforeUnmount(){
        console.log('A组件销毁之前');
    },
    unmounted(){
        console.log('A组件销毁之后');
    },
    methods:{
        up(){
            this.msg = "新数据"
        }
    }
}
</script>